<?xml version="1.0" encoding="UTF-8"?>
<!--
    This file is part of "Information Connections Engine".

    "Information Connections Engine" is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 2 of the License, or
    (at your option) any later version.

    "Information Connections Engine" is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with "Information Connections Engine".  If not, see http://www.gnu.org/license.
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           targetNamespace="InformationConnectionsEngine.data"
           xmlns="InformationConnectionsEngine.data"
           elementFormDefault="qualified">

  <xs:element name="iceData" type="Root"/>

  <xs:complexType name="Action">
    <xs:sequence>
      <xs:any maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="idref" use="required"/>
  </xs:complexType>

  <xs:complexType name="Node">
    <xs:sequence>
      <xs:element name="actions" maxOccurs="1" minOccurs="0">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="action" type="Action" maxOccurs="unbounded"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="drawingInformation" maxOccurs="1" minOccurs="0">
        <xs:complexType>
          <xs:sequence>
            <xs:any maxOccurs="unbounded"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="refreshRate" type="xs:nonNegativeInteger" maxOccurs="1"  minOccurs="0"/>
      <xs:element name="relativeSize" type="xs:string" maxOccurs="1"  minOccurs="0"/>
      <xs:element name="style" type="xs:string" maxOccurs="1"  minOccurs="0"/>
      <xs:element name="title" type="xs:string" maxOccurs="1"  minOccurs="0"/>
      <xs:element name="type" type="xs:string" maxOccurs="1" minOccurs="1"/>
      <xs:element name="url" type="xs:string" maxOccurs="1" minOccurs="1"/>
    </xs:sequence>
    <xs:attribute name="id" type="xs:ID" use="required"/>
  </xs:complexType>


  <xs:complexType name="Link">
    <xs:sequence>
      <xs:element name="actions" maxOccurs="1">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="action" type="Action" maxOccurs="unbounded"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="drawingInformation" maxOccurs="1">
        <xs:complexType>
          <xs:sequence>
            <xs:any maxOccurs="unbounded"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="grammar" maxOccurs="1" minOccurs="1">
        <xs:complexType>
          <xs:all>
            <xs:element name="verb" type="xs:string"/>
            <xs:element name="complement" type="xs:string"/>
          </xs:all>
        </xs:complexType>
      </xs:element>
      <xs:element name="strength" maxOccurs="1">
        <xs:simpleType>
          <xs:restriction base="xs:float">
            <xs:minInclusive value="1"/>
            <xs:maxInclusive value="100"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="style" type="xs:string" maxOccurs="1"/>
    </xs:sequence>
    <xs:attribute name="id" type="xs:ID" use="required"/>
    <xs:attribute name="to" type="xs:IDREF" use="required"/>
    <xs:attribute name="from" type="xs:IDREF" use="required"/>
  </xs:complexType>


  <xs:complexType name="Root">
    <xs:sequence>
      <xs:element name="currentNode">
        <xs:complexType>
          <xs:sequence>
            <xs:element maxOccurs="1" minOccurs="1" name="node" type="Node"/>
            <xs:element name="link" type="Link" maxOccurs="unbounded"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="neighbors">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="node" type="Node" maxOccurs="unbounded"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

</xs:schema>
